package com.syqc.netlib.https

import java.security.cert.X509Certificate
import javax.net.ssl.X509TrustManager

/**
 *@Author Jasper
 *@Time 2021/10/11 11:25
 *@Desc
 */

/**
 * 为了解决客户端不信任服务器数字证书的问题，网络上大部分的解决方案都是让客户端不对证书做任何检查，
 * 这是一种有很大安全漏洞的办法
 */
class MX509TrustManager : X509TrustManager {
    override fun checkClientTrusted(chain: Array<out X509Certificate>?, authType: String?) {

    }

    override fun checkServerTrusted(chain: Array<out X509Certificate>?, authType: String?) {

    }

    override fun getAcceptedIssuers(): Array<X509Certificate> {
        return arrayOf<X509Certificate>()
    }
}